package com.mbds.activities;

import com.example.sismapp.R;

import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.view.MenuItem;

/**
 * Define actions for menu items
 * All Activity with the menu must extends this abstract class
 */
public class Abs_Activity extends ActionBarActivity {
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.menu_map) {
			Intent map = new Intent(this, MapActivity.class);
			startActivity(map);
		} else if (id == R.id.menu_settings) {
			Intent settings = new Intent(this, SettingsActivity.class);
			startActivity(settings);
		} else if (id == R.id.menu_earth) {
			Intent earth = new Intent(this, EarthQuakeActivity.class);
			// onStop();
			startActivity(earth);
		}
		return super.onOptionsItemSelected(item);
	}
}
